The basics of the Model Tree Editor
This section will help you to get accustomed with the Model Tree Editor. During this "training" session, you will be prompted to perform some operations which require the availability of a few sub-assies and chains. Thus, before we start the demo, I suggest you to create a new assembly to be called MYASSY (File/Rename menu option, master project option unchecked) and several sub-assies. Three sub-assies would be great (not including the Desk nor the Lines sub-assy). Let us call them MYSUB1, MYSUB2 and MYSUB3. Populate these sub-assies with a few polygons in each of them: some triangles that you build by clicking randomly on the screen in the create a chain mode. Then, while you are in the Graphic Editor, select the Lines sub-assy and create a couple of lines.

OK. So, I assume it didn't take you a long time to do that. Open the Model Tree Editor by clicking on the model tree editor button of the Graphic Editor tool bar or by selecting the File/Model Tree Editor menu option or by hitting the F9 key. The Model Tree Editor window is now displayed on the screen.


Tip: If you have declared the file you are working with as a main project, you can display the project code page by clicking on the main project button. If you are working on a simple assembly, this button is assigned to the compilation process.

The Model Tree Editor window is composed of:

In the model tree display panel, each node is featured by an icon and a caption. The icon depends upon the node kind: When the background color of the icon is pink, it means that the node attributes are undefined. The id number of the selected node is displayed in the left part of the status bar. The rigth part of it displays warning or error messages.

Clicking on a node selects it.

When you first open the Model Tree Editor, the tree is pretty small: it is limited to the root node. You can see in the sub-assy panel that there is no checked sub-assy, meaning that ther is no sub-assy assigned to the tree.
Should you compile the model at the moment, it would yield... nothing.

Add a node

You can add a node either by clicking on the add to root node button or by clicking on the add button:

Click on a node to select it. The node caption is highlighted. Now click on the add button. The node selection panel is displayed.


Tip: To get more information on the Model Tree Editor, have a look at the Model Tree Editor reference guide section of this tutorial.

Select the sub-assy option and validate. A sub-assy node is added to the tree. It is a child of the root node and it is undefined (the icon background color is pink). Click on the sub-assy node to select it and then click on the properties button. The sub-assy selection window is displayed. Select one of the existing sub-assies (for instance, the MYSUB1 one) and validate. The model tree editor is updated:

Should you compile the model at the moment, it would yield a model limited to the selected sub-assy.

Tip: The AD2K2 Model Editor allows you to insert comment nodes. To do that, insert a no-op node and then click on the properties button. An input window is launched which allows you to enter a comment.

While the sub-assy node is selected, click on the add button. An error message is displayed in the status bar. No child node can be added to a sub-assy node.

Animation node

Click on the root node to select it. Click on the add button and select the animation option. Validate. An animation node is added as a child node of the assembly. It is colored in pink since it is undefined. Click on the animation node to select it and then on the properties button to assign it an animation block. The animation block editor is displayed.

Select the kind of part you want to animate in the left sub-panel of the animation block editor: let us go for a right gear. Create an animation block by clicking on the create button in the block creation/selection sub-panel (let us call it MYBLOCK). Select the rotation radio button and validate. The animation block editor is updated to display the angle curve creation/selection sub-panel and the hinge selection sub-panel.

A rotation block calls for a hinge which you define in the Graphic Editor. Exit the animation block editor by clicking on the OK button and then exit the Model Tree Editor by clicking on the Quit button. Hinges are defined with the Utilities/Define a hinge menu option.


A hinge can be made up of:

When the define a hinge input panel is displayed on the right of the graphic editor window, you are prompted to select a point (i.e. a vertex). You do that by clicking on it on the navy/blue graphic editor display window. A small red square highlights the vertex that you select. When you are satisfied with your selection, validate by clicking on the small OK button. You are then prompted to select another vertex or to enter the three coordinates of a vector. Validate by clicking on the small OK button when you are finished and then exit the input panel by clicking on the large OK button.


Once you have defined a hinge, go back to the Model Tree Editor, select the animation node and open the animation block editor. Clicking on the small blue button of the hinge selection sub-panel loads the currently selected hinge in the hinge list. Using the left and right arrows makes you cycle through the hinge list. Clicking on the reverse button inverts the rotation.

We still have to assign an angle curve to the rotation block. Angle curves are discussed in other sections of this tutorial (the rotation block application note and the model tree editor application note). For the sake of this demo, I suggest that we just create the simplest curve: a line. Click on the create button of the curve creation/selection sub-panel and enter MYCURVE in the name input field. Validate. The small curve display window at the bottom of the sub-panel shows an horizontal line. Click on the edit button. The curve editor is open.


On the right, a small array displays the points which defines the curve. Select the second row of the array and click on the modify button at the bottom of the array. Enter 90 in the var input field just below the curve display panel. Validate by clicking on the OK button and exit the curve editor by clicking again on the OK button. The small curve display window at the bottom of the curve creation/selection sub-panel is updated. Exit the animation block editor by clicking on the OK button. The Model Tree Editor is updated:

Tip: The gear animation process is a little bit more complex. The animation sequence is splitted in two parts. The first one is dedicated to the gear retraction/deployment and the second one to the damping effect. Please have a look to the section of this tutorial dedicated to the animation blocks to get more details.

This animation node is now fully defined but it applies to nothing. Make sure it is selected and click on the add button. The node selection window is displayed. Select the sub-assy option and validate. An undefined sub-assy node is added to the tree as a child of the animation node. Click on the properties button, assign a sub-assy to the node (for instance, the MYSUB2 sub-assy) and validate. Looking at the sub-assy panel, you will see that the MYSUB2 sub-assy is checked.

Should you compile the model at the moment, it would yield a model composed of MYSUB1 and MYSUB2. The MYSUB2 sub-assy would move when the gear retraction control key is pressed.

Combined animation

The tree structure allows for combined animation. Click on the animation node to select it. Add another animation node as a child of this node. The first animation node has now two child-nodes: the MYSUB2 sub-assy node and an undefined animation node. Select this second animation node and open the animation block editor. Look at the combo-box in the block creation/selection sub-panel. The MYBLOCK animation block is available in the list. Select it and exit the animation block editor. Make sure the second animation node is still selected and click on the add button to add a sub-assy node. Assign the MYSUB3 sub-assy to this node.

This combination yields a model composed of MYSUB1, MYSUB2 and MYSUB3. The gear retraction control key controls the animation of both MYSUB2 and MYSUB3, the MYSUB3 sub-assy moving twice as quicker as the MYSUB2 one.

This animation does not fit your needs? Select the first animation node and click on the modify button. A node selection window is displayed with a limited selection set. Select the moving option and validate. Look at the resulting tree: the animation node was turned into a moving node but the child-nodes are unchanged. Click on the properties button. The moving attribute window is displayed.


Select the rudder option and click on the small blue button to load the currently selected hinge.

This new combination yields a model composed of MYSUB1, MYSUB2 and MYSUB3. The rudder command controls the rotation of both MYSUB2 and MYSUB3 around the hinge while the gear retraction control key animates the MYSUB3 sub-assy.

Tip: Replacing the animation node by a rolling node would bring a similar result, except that the main attribute of a rolling node is a vector instead of a hinge. Use the Utilities/Make a vector menu option of the Graphic Editor to create a vector. To select the appropriate vector in the rolling attribute window you can either:

  • use the arrows at the left of the panel to cycle through the vector list,
  • or click on the small blue button to loads the currently selected vector in the vector list.

Wire and light items

Animated and static sub-assies are not the only items which are handled by the Model Tree Editor. It also supports colored lines and various light items. Select the root node or one of the animation nodes. Click on the add button to add a wire node and validate. Click on the properties button to open the wire attribute window. The wire attribute window allows you to select one of the chains of the Lines sub-assy and to assign it a color.

Click somewhere on the color palette, adjust the intensity bar and load the chain currently selected in the Lines sub-assy by clicking on the small blue button. Validate. The node attribute displays the selected chain features (number of vertices and vertex indexes) and the color hex value.

Select again the root node or one of the animation nodes and add a light node. Click on the properties button to open the light attribute window.

The light attribute window allows you to select the light kind you want to add and to define its location and direction (in case of a light cone). Select the nav option and enter:
    x = 0.000    y = 2.000    z = 0.000
in the position coordinate input field. The navigation light is a spot light: the vector coordinate input field are disabled. Select now the taxi option. As the taxi light is a light cone, the vector coordinate input fields are enabled. Enter:
   vx = 0.000   vy = 1.000   vz = 0.000
in the input fields and validate. Back in the Model Tree Editor, look at the node attribute panel: it displays the light kind, the color index, the light item location and the light cone direction.

Tip: Select the view/show light spots Graphic Editor menu option to display the light items location in the Graphic Editor.

Tip: You cannot add a child to a wire node nor to a light node.


Test node

A model may require some parts to be conditionally displayed. For instance, you may want to hide the gear when it is fully retracted. The test node gives you that option. There are two kinds of test nodes:

Select the root node or one of the anim, moving or rolling nodes. Click on the add button, select the test option and validate. A test node is added. It is automatically fitted with two child nodes.

Tip: A test node must has two child nodes: one is used when the test is true, the othe one when the test is failed. You cannot delete a child node directly linked to a test node. You cannot add a child node to a test node.

Select the test node and click on the properties button to open the test attribute window.


When you select a prop speed test option or a flap test option the test attribute window is modified to display a range data input sub-panel. When you select any of the other options, this sub-panel is concealed. Select the right gear up option and validate. Let us assume the gear is modelled by the MYSUB1 sub-assy and that you want to hide it when it is fully retracted. Hiding it means you want to display nothing. We shall do it by adding a no operation node to the first child of the test node. Let us now consider the other branch of the test: it shall represent the animated gear. We could add an animation node to the second child node of the test. We will do it simpler. Select this second node and click on the modify button. A node selection window is displayed. Select the animation option and validate. The second child node is turned into an animation node. Select this animation node. Assign it an animation block (properties button) and then add it a sub-assy node (add button). Assign the MYSUB1 sub-assy to this sub-assy node. This is it!

Tip: You want to invert the two child nodes of a test node ? Select the test node and click on the modify button.


Compilation

Once you are finished with the assembly, you have two options:

Please look at the section of this tutorial dedicated to the project editor to get more information on it.


copyright Hervé Devred, 2003